package xu.zhi.qing.user.dao;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import xu.zhi.qing.common.dao.BaseDao;
import xu.zhi.qing.common.entity.Pagination;
import xu.zhi.qing.user.entity.User;

import java.util.List;

@Repository
public interface UserDao extends BaseDao<User> {
	/**
	 * 根据用户名查找用户，找到返回User,找不到返回null
	 * @param username
	 * @return
	 */
	User findByUsername(@Param("username")String username);

	List<User> findAllByUsername(@Param("username")String username);

	User findById(@Param("id")Integer id);

	User updateById(User user);

	List<User> findByPagination(Pagination pagination);

	Integer countByLikeUsername(@Param("username")String username);
}